package se.jagvetintedu;

import java.math.BigInteger;

public class Problem16 {
	
	public Long solve(int x) {
		BigInteger start = new BigInteger("2");
		BigInteger val = start.pow(1000);
		
		String valStr = val.toString();
		
		System.out.println(valStr);
		System.out.println(valStr.length());
		
		Long sum = 0L;
		for (int t = 0; t < valStr.length(); t++) {
			sum += Character.getNumericValue(valStr.charAt(t));
		}
		return sum;
	}
	
	public static void main(String args[])
	{
		System.out.println("Project Euler, problem 16");
		
		Problem16 solution = new Problem16();

		System.out.println("number of ways through a 20x20 grid are: " + solution.solve(20));
	}
}
